package com.example.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author 王鹤蒲
 * @since 2024-01-29
 */
@Data
@Accessors(chain=true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_appointment_scheduler")
@ApiModel(value = "AppointmentScheduler对象", description = "")
public class AppointmentScheduler implements Serializable {

    private static final long serialVersionUID = 1L;

      @ApiModelProperty("排班ID")
      @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      @ApiModelProperty("医生ID")
      private Integer doctorId;

      @ApiModelProperty("科室ID")
      private Integer departmentId;

      @ApiModelProperty("排班日期")
      @JsonFormat(pattern="yyyy-MM-dd",timezone ="GMT+8" )
      @JsonSerialize(using = LocalDateSerializer.class)
      @JsonDeserialize(using= LocalDateDeserializer.class)
      private LocalDate workDate;

      @ApiModelProperty("排班时间('0'：上午，'1'：下午)")
      private String dayPart;

      @TableField(exist = false)
      @ApiModelProperty("星期数")
      private String dayOfWeek;

      @ApiModelProperty("开始时间")
      @JsonFormat(pattern="HH:mm:ss",timezone ="GMT+8" )
      @JsonSerialize(using = LocalTimeSerializer.class)
      @JsonDeserialize(using= LocalTimeDeserializer.class)
      private LocalTime startTime;

      @ApiModelProperty("结束时间")
      @JsonFormat(pattern="HH:mm:ss",timezone ="GMT+8" )
      @JsonSerialize(using = LocalTimeSerializer.class)
      @JsonDeserialize(using= LocalTimeDeserializer.class)
      private LocalTime endTime;

      @ApiModelProperty("看诊地点")
      private String location;

      @ApiModelProperty("可预约数")
      private Integer reservedNumber;

      @ApiModelProperty("剩余预约数")
      private Integer availableNumber;

      @ApiModelProperty("停诊原因")
      private String suspendReason;

      @ApiModelProperty("排班状态（'-1'：停诊，'0'：停约，'1'：可约）")
      private String status;

      @ApiModelProperty("删除状态")
      private String delFlag;

      @ApiModelProperty("创建者")
      private String createBy;

      @ApiModelProperty("创建时间")
      @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8" )
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      @JsonDeserialize(using= LocalDateTimeDeserializer.class)
      private LocalDateTime createTime;

      @ApiModelProperty("更新者")
      private String updateBy;

      @ApiModelProperty("更新时间")
      @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8" )
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      @JsonDeserialize(using= LocalDateTimeDeserializer.class)
      private LocalDateTime updateTime;

      @ApiModelProperty("备注")
      private String remark;

      @TableField(exist = false)
      private Doctor doctor;


}
